package com.tinno.chargelauncher;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;

import com.tinno.chargelauncher.charge.WiredChargingAnimation;
import com.tinno.chargelauncher.receiver.BatteryReceiver;
import com.tinno.chargelauncher.view.ChargingView;


public class MainActivity extends AppCompatActivity {

	private BatteryReceiver mReceiver;

	private ChargingView mChargingView;

	private View overlayView;
	private WindowManager windowManager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		/**
		 * 全屏显示
		 */
		/*overlayView = View.inflate(this, R.layout.charge_animator, null);
		mChargingView = overlayView.findViewById(R.id.charging);
		mChargingView.setProgress(15);
		windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
		WindowManager.LayoutParams params = new WindowManager.LayoutParams();
		params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
				| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
				| WindowManager.LayoutParams.FLAG_FULLSCREEN
				| WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
		params.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
		params.format = PixelFormat.TRANSLUCENT;
		params.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
		params.systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
				| View.SYSTEM_UI_FLAG_FULLSCREEN
				| View.SYSTEM_UI_FLAG_IMMERSIVE
				| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
				| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
				| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
		WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView());
		windowInsetsControllerCompat.setSystemBarsBehavior(WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
		windowInsetsControllerCompat.hide(WindowInsetsCompat.Type.systemBars());
		windowManager.addView(overlayView, params);*/


		WiredChargingAnimation.makeWiredChargingAnimation(this, null, 15,false).show();
	}
}